﻿//
// *************************************************************************************
// WP-Framework
//
// Developed by 
// Lukas Kretschmar (lkretschmar.dev@bluewin.ch)
//
// Switzerland, Copyright (c) 2013 lkretschmar
// This content is released under the MIT License (http://opensource.org/licenses/MIT).
//     
// *************************************************************************************
//
//


using System.Linq.Expressions;
using KretschIT.WP_Fx.EasyMoq.Calls.Arguments;
using System.Collections.Generic;
using KretschIT.WP_Fx.EasyMoq.Extensions;

namespace KretschIT.WP_Fx.EasyMoq.Calls.Collections.Items
{
    internal class MethodCallItem : CallItem, IMethodCallItem
    {
        public MethodCallItem(MethodCallExpression call)
            : base(call)
        {
            this.Arguments = call.Arguments.ToArguments();
        }

        private IEnumerable<IArgument> Arguments { get; set; }

        protected override bool HasSameArguments(MethodCallExpression methodCall)
        {
            var matcher = methodCall.Arguments.ToMatchers();
            return this.Compare(matcher, this.Arguments);
        }
    }
}
